Carbon


StandardAlert

Header: Dialogs.h Carbon status: Supported

Displays a standard alert box.

OSErr StandardAlert (
    AlertType inAlertType, 
    StringPtr inError, 
    StringPtr inExplanation, 
    AlertStdAlertParamPtr inAlertParam, 
    SInt16 *outItemHit
);
inAlertType

A constant indicating the type of alert box you wish to create; see “Alert Type Constants”.

inError

A pointer to a Pascal string containing the primary error text you wish to display.

inExplanation

A pointer to a Pascal string containing the secondary text you wish to display; secondary text is displayed in the small system font. Pass null to indicate no secondary text.

inAlertParam

A pointer to the standard alert structure; see AlertStdAlertParamRec. Pass null to specify that you do not wish to your alert box to incorporate any of the features that the standard alert structure provides.

outItemHit

A pointer to a signed 16-bit integer value. On return, the value indicates the alert button pressed; see “Alert Button Constants”.

function result

A result code.

DISCUSSION

The StandardAlert function displays an alert box based on the values you pass it. You can pass the error text you wish displayed in the error and explanation parameters, and customize the alert button text by filling in the appropriate fields of the standard alert structure passed in the inAlertParam parameter.

StandardAlert automatically resizes the height of a dialog box to fit all static text. It ignores alert stages and therefore provides no corresponding alert sounds.

SPECIAL CONSIDERATIONS

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when CarbonLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by CarbonLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)